<%@ include file="../tagJSONLibIncludes.jsp" %>
<c:set var="systemProperties" value=""></c:set>
<c:set var="customProperties" value=""></c:set>
<c:set var="isCheckedout" value="false"></c:set>
{
   informationUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/edit',
   checkinUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/checkin',
   checkoutUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/checkout',
   cancelCheckoutUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/cancelCheckout',
   downloadUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/download',
   modifyUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/modify',
   deleteUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/delete',
   securityUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/security/list',
   historyUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/history',
   synSecurityUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/security/sync',
   listclassIntsUrl:'${auth}/classInst/${classDefType}/${selectedClassDefId}/history',
   downloadDialogTitle:'<fmt:message key="classInst.download.dialog.title"/>',
   downloadDialogContent:'<fmt:message key="classInst.download.dialog.content"/>',
   checkoutDialogTitle:'<fmt:message key="classInst.checkout.dialog.title"/>',
   checkoutDialogContent:'<fmt:message key="classInst.checkout.dialog.content"/>',
   cancelCheckoutDialogTitle:'<fmt:message key="classInst.cancelCheckout.dialog.title"/>',
   cancelCheckoutDialogContent:'<fmt:message key="classInst.cancelCheckout.dialog.content"/>',
   deleteDialogTitle:'<fmt:message key="classInst.delete.dialog.title"/>',
   deleteDialogContent:'<fmt:message key="classInst.delete.dialog.content"/>',
   form1:{title:'<fmt:message key="classInst.title.information"/>',
        form:{actionUrl: '',
         formName: 'classInst',
         fields:[
         <c:forEach var="property" items="${propertyDefs}" varStatus="status">
            <c:choose>
                <c:when test="${property.property.propertyType == 3 }">
                <c:set var="content">{name:"propertyValues[${status.index}].value", disable:"true", value:"${fn:formatShortDate(property.value, sessionScope["OCM.timezoneOffset"])}", label:"${property.property.displayName}", type:"label"},</c:set>
                </c:when>
                <c:otherwise>
                <c:set var="content">{name:"propertyValues[${status.index}].value", disable:"true", value:${fn:parseJsonString(property.value)}, label:"${property.property.displayName}", type:"label"},</c:set>
                </c:otherwise>
            </c:choose>
            <c:if test="${property.property.name == 'isCheckedout'}">
                <c:set var="isCheckedout" value="${property.value}"></c:set>
            </c:if>
            <c:if test="${property.property.editable == false}"><c:set var="systemProperties">${systemProperties}${content}</c:set></c:if>
            <c:if test="${property.property.editable == true}"><c:set var="customProperties">${customProperties}${content}</c:set></c:if>
         </c:forEach>
         {name:"layout", type:"group", title:"<fmt:message key="classInst.title.information.customproperties"/>"},
         ${customProperties}
         {name:"layout", type:"group", title:"<fmt:message key="classInst.title.information.systemproperties"/>"},
         ${systemProperties}
         ]
        }
   },
    pageUI:[{type:"toolbar", content:[
            <c:if test="${classDefType == 0}">
                <c:if test="${isCheckedout == 'false'}">
                {label:"<fmt:message key="toolbar.checkout"/>",name:"checkout", iconClass:"toolbarIcon toolbarCheckoutIcon"},
                {label:"<fmt:message key="toolbar.delete"/>",name:"delete", iconClass:"toolbarIcon toolbarDeleteIcon"},
                </c:if>
                <c:if test="${isCheckedout == 'true'}"> 
                {label:"<fmt:message key="toolbar.checkin"/>",name:"checkin", iconClass:"toolbarIcon toolbarCheckInIcon"},
                {label:"<fmt:message key="toolbar.cancelCheckout"/>",name:"cancelCheckout", iconClass:"toolbarIcon toolbarCancelCheckoutIcon"},
                </c:if>
                {label:"<fmt:message key="toolbar.security"/>",name:"security", iconClass:"toolbarIcon toolbarSecurityIcon"},
                <c:if test="${hasSyncSecurity == false}">
                {label:"<fmt:message key="toolbar.syncsecurity"/>",name:"syncsecurity", iconClass:"toolbarIcon toolbarSyncSecurityIcon"},
                </c:if>
                {label:"<fmt:message key="toolbar.download"/>",name:"download", iconClass:"toolbarIcon toolbarDownloadIcon"},
                {label:"<fmt:message key="toolbar.history"/>",name:"history", iconClass:"toolbarIcon toolbarHistoryIcon"},
             </c:if> 
             <c:if test="${classDefType == 1}">
                {label:"<fmt:message key="toolbar.modify"/>",name:"modify", iconClass:"toolbarIcon toolbarModifyIcon"},
                {label:"<fmt:message key="toolbar.security"/>",name:"security", iconClass:"toolbarIcon toolbarSecurityIcon"},
                <c:if test="${hasSyncSecurity == false}">
                {label:"<fmt:message key="toolbar.syncsecurity"/>",name:"syncsecurity", iconClass:"toolbarIcon toolbarSyncSecurityIcon"},
                </c:if>
                {label:"<fmt:message key="toolbar.delete"/>",name:"delete", iconClass:"toolbarIcon toolbarDeleteIcon"},
             </c:if>
             ]},
            {type:"panel",content:[{type:"form", name:"form1"}]}]
}